package com.spring.utils.api_v4.controller.ui;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spring.utils.api_v4.pojo.DeptInfo;
import com.spring.utils.api_v4.pojo.salary.DeptWage;
import com.spring.utils.api_v4.pojo.salary.task.WageTask;
import com.spring.utils.api_v4.util.DoubleSerialize;
import lombok.Data;
import lombok.ToString;

import java.time.LocalDate;

/**
 * 部门工资任务
 */
@Data
@ToString
public class DeptWageTaskItem {
    private String id;
    @JsonIgnore
    private DeptWage dept;
    @JsonIgnore
    private WageTask task;          // 所属任务
    @JsonSerialize(using = DoubleSerialize.class)
    private double meritPay = 0;    // 历史余额
    @JsonSerialize(using = DoubleSerialize.class)
    private double totalMerit = 0;  // 绩效总额
    @JsonSerialize(using = DoubleSerialize.class)
    private double disMerit = 0;    // 已分配绩效
    private int state = 0;          // 状态 0:初始 1:设置完成 2:锁定
    private LocalDate createTime;   // 创建时间
    private String note;            // 说明

    public int getTaskId() {
        return task.getId();
    }

    public String getDeptName() {
        return dept.getName();
    }

    public int getDeptId() {
        return dept.getId();
    }
}
